package android.slc.appbase.api.slc.converter;

import android.slc.appbase.api.slc.callback.po.SlcEntity;

import androidx.annotation.NonNull;

import java.io.IOException;

public class SlcEntityErrorException extends IOException {
    private final SlcEntity<?> slcEntity;

    public SlcEntityErrorException(int errorCode, String message) {
        this(SlcEntity.createSlcEntity(errorCode, null, message));
    }

    public SlcEntityErrorException(@NonNull SlcEntity<?> slcEntity) {
        super(slcEntity.getMsg());
        this.slcEntity = new SlcEntity<>();
    }

    public int getErrorCode() {
        return this.slcEntity.getCode();
    }

    public SlcEntity<?> getSlcEntity() {
        return slcEntity;
    }
}
